# Contributor: k0r10n <k0r10n.dev@gmail.com>
# Contributor: Ivan Tham <pickfire@riseup.net>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks
pkgname=extra-cmake-modules
pkgver=5.113.0
pkgrel=0
pkgdesc="Extra CMake modules"
url="https://invent.kde.org/frameworks/extra-cmake-modules"
arch="noarch"
license="BSD-3-Clause"
depends="cmake"
makedepends="
	py3-sphinx
	samurai
	"
checkdepends="
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	qt5-qttools-dev
	"
_repo_url="https://invent.kde.org/frameworks/extra-cmake-modules.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/extra-cmake-modules-$pkgver.tar.xz"
subpackages="$pkgname-doc"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DSphinx_BUILD_EXECUTABLE=/usr/bin/sphinx-build \
		-DBUILD_QTHELP_DOCS=ON
	cmake --build build
}

check() {
	# KDEFetchTranslations expects KDE's git setup
	ctest --test-dir build --output-on-failure -E "KDEFetchTranslations"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
63a9bc19432a51bfaf1618b0e2cb4ce4ae188f0a2dfc44717c9a666df3f38222c3f5ebf9f210f33d400b0405e07b1574ff4de98b7dae23003785a9ea2a430e52  extra-cmake-modules-5.113.0.tar.xz
"
